package dimension.starry.recipe;

import dimension.starry.item.ItemRegisterManager;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;

public class BreakingHammer {
    /**
     * todo not craft event
     */
//    public static void onCraftItem(ServerPlayerEntity player, ItemStack result) {
//        boolean isCopper = result.getItem().getTranslationKey().equals(ItemRegisterManager.BROKEN_COPPER.getItem().getTranslationKey());
//        boolean isTin = result.getItem().getTranslationKey().equals(ItemRegisterManager.BROKEN_TIN.getItem().getTranslationKey());
//        if (isCopper || isTin) {
//            for (int i = 0; i < player.getInventory().size(); i++) {
//                ItemStack itemStack = player.getInventory().getStack();
//                if (itemStack.getItem().getTranslationKey().equals(ItemRegisterManager.BREAKING_HAMMER.getItem().getTranslationKey())) {
//                    if (itemStack.getMaxDamage() >= itemStack.getDamage()) {
//                        ItemStack newHammer = new ItemStack(ItemRegisterManager.BREAKING_HAMMER.getItem());
//                        newHammer.setDamage(itemStack.getDamage() + 1);
//                        event.getPlayer().addItemStackToInventory(newHammer);
//                        event.setResult(Event.Result.ALLOW);
//                    }
//                }
//            }
//        }
//    }

}
